package com.example.tellwin.view;

import com.example.tellwin.api.TwjfApi;
import com.example.tellwin.base.RxPresenter;
import com.example.tellwin.base.SimpleCallback;
import com.example.tellwin.mine.contract.ApplyResultContract;
import com.example.tellwin.utils.HttpUtils;

import javax.inject.Inject;

import okhttp3.HttpUrl;
import okhttp3.RequestBody;

public class SharePresenter extends RxPresenter<ShareContract.View> implements ShareContract.Presenter<ShareContract.View>  {

    private TwjfApi mApi;

    @Inject
    public SharePresenter(TwjfApi mApi) {
        this.mApi = mApi;
    }

    @Override
    public void share(String shareType, String relationId) {
        RequestBody requestBody = HttpUtils.getRequestBody("shareType" ,shareType,"relationId" ,relationId);
        mApi.share(requestBody, new SimpleCallback<Object>(mView) {
            @Override
            public void onSuccess(Object o) {

            }

            @Override
            public void onFail(String msg) {

            }
        });
    }
}
